/***************************************************************************
 *            callbacks.c
 *
 *  Tue Jun 13 21:42:51 2009
 *  Copyright  2009  fantasy
 *  <fantasy614@gmail.com>
 ****************************************************************************/

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
 */
#ifndef _CALLBACK_H 
#define _CALLBACK_H 
#include "global.h"

GtkWidget *win_dialog;

struct move *red_move,*black_move ;

GdkPixbuf* chessman_images[20];
GdkPixbuf* buf ;

gboolean read_image();
void init_board(GtkWidget*widget);
void destroy_callback(GtkWidget*widget,gpointer data);

gboolean 
expose_event_callback(GtkWidget*widget,GdkEventExpose*event,
gpointer data);

gboolean
button_press_event_callback(GtkWidget*widget,
GdkEventButton*event,gpointer data);


void  draw_chessman(GtkWidget*widget);
void  redraw_src(struct board*src_pos,GtkWidget*widget);
void  get_think(struct move*red_move,GtkWidget*widget);
void  get_first_select(int board_x,int board_y,int j,GtkWidget *widget);
void  draw_seleceted(int board_x,int board_y,GtkWidget *widget);
void  print_board();

#endif
